package com.cheng.chengrobot.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import net.mamoe.mirai.contact.Group;

@TableName("robot_group")
@Data
public class RobotGroup
{
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Long robotQq;
    private Long groupQq;
    private String groupName;
    private Boolean playgroundManager;
    private Boolean chatGpt;

    public static RobotGroup getInstanceFromGroup(Group group)
    {
        RobotGroup robotGroup = new RobotGroup();
        robotGroup.setId(null);
        robotGroup.setRobotQq(group.getBot().getId());
        robotGroup.setGroupQq(group.getId());
        robotGroup.setGroupName(group.getName());

        return robotGroup;
    }
}
